﻿<div class="modal-header">
    <cts-title id="pnTitle" text="{{strings.Title}}">
        <cts-image onclick="close()" src="/res/adm/img/icons/close.png" class="close" border="false" transparent="true" data-original-title="{{strings.Close}}" ui-jq="tooltip"></cts-image>
    </cts-title>
</div>
<div class="modal-body">
    <cts-toolbar id="pnToolbar">
        <cts-toolbar-item id="lnkUpdateAll" onclick="updateAll()" class="left-1" src="/res/adm/img/icons/save.png" data-original-title="{{strings.UpdateAll}}" ui-jq="tooltip" ></cts-toolbar-item>
        <cts-toolbar-item id="lnkDeleteAll" onclick="deleteAll()" class="left-2" src="/res/adm/img/icons/delete.png" data-original-title="{{strings.DeleteAll}}" ui-jq="tooltip"></cts-toolbar-item>
    </cts-toolbar>
    <cts-form-pane id="pnUpload" class="p-height-4" style="margin-top: 5px">
        <cts-label class="top-1 left-1 width-8" text="{{strings.File}}"></cts-label>
        <cts-file id="flUpload" tabindex="10" model="data.FileStream" class="top-1 left-4 width-20"></cts-file>
        <cts-label class="top-2 left-1 width-8" text="{{strings.FileAlias}}"></cts-label>
        <cts-text id="txtFileName" tabindex="20" model="data.FileAlias" class="top-2 left-4 width-15"></cts-text>
        <cts-label class="top-3 left-1 width-8" text="{{strings.SortKey}}"></cts-label>
        <cts-number class="top-3 left-4 width-7" scale="0" min="1" max="999" tabindex="30" model="data.SortKey"></cts-number>
        <cts-button id="btnUpload" tabindex="40" class="top-4 left-4 width-8" text="{{strings.Upload}}" onclick="uploadFile()"></cts-button>
    </cts-form-pane>
    <cts-grid-Pane id="pnResult" class="upload-tblResult" style="margin-top: 5px">
        <table dt-options="tblResult.Options" datatable="ng">
            <thead>
            <tr>
                <td width="30px"></td>
                <td width="150px" text="{{strings.ColFileAlias}}" cts-grid-header="true"></td>
                <td width="80" text="{{strings.ColSortKey}}" cts-grid-header="true"></td>
                <td width="326" text="{{strings.ColFile}}" cts-grid-header="true"></td>
            </tr>
            </thead>
            <tbody>
            <tr ng-repeat="obj in tblResult.ListData">
                <td><input type="checkbox" ng-model="obj.HasChanged"/></td>
                <td class="editable">
                    <cts-text model="obj.FileAlias" tabindex="50" onchange="tblResultChange(data, obj)"></cts-text>
                </td>
                <td class="editable">
                    <cts-number model="obj.SortKey" scale="0" min="1" max="999" tabindex="60" onchange="tblResultChange(data, obj)"></cts-number>
                </td>
                <td>
                    <span ng-if="data.FileType == 'image'">
                        <cts-image src="{{obj.FileName + '_min'}}" border="false" transparent="true" style="margin: 2px;"></cts-image>
                    </span>
                    <span ng-if="data.FileType == 'general'">
                        {{obj.FileName}}
                    </span>
                </td>
            </tr>
            </tbody>
        </table>
    </cts-grid-Pane>
    <cts-alert model="alert"></cts-alert>
</div>